<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/wmsproject/reports/Wms_Inventory.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/wmsproject/reports/Wms_Inventory.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    name: "Wms_Inventory",
    setup() {
        const table = ref({
            key: "InventoryId",
            footer: "Foots",
            cnName: "物料库存表",
            name: "reports/Wms_Inventory",
            newTabEdit: false,
            url: "/Wms_Inventory/",
            sortName: "InventoryId"
        });
        const editFormFields = ref({ "WarehouseId": [], "Remarks": "", "MaterialId": "", "Qty": "" });
        const editFormOptions = ref([[{ "title": "备注", "field": "Remarks" },
        { "dataKey": "WMS_Warehouse", "data": [], "title": "仓库", "field": "WarehouseId", "type": "selectList" }],
        [{ "dataKey": "WMS_Material", "data": [], "title": "物料", "field": "MaterialId", "type": "select" },
        { "title": "库存数量", "required": true, "field": "Qty", "type": "decimal" }]]);
        const searchFormFields = ref({ "WarehouseId": "", "MaterialId": "", "overQty":1 });
        const searchFormOptions = ref([[{ "dataKey": "WMS_Warehouse", "data": [], "title": "仓库", "field": "WarehouseId", "type": "select" }, { "dataKey": "WMS_Material", "data": [], "title": "物料", "field": "MaterialId", "type": "select" }]]);
        const columns = ref([{ field: "InventoryId", title: "ID", type: "bigint", width: 110, hidden: true, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "WarehouseId", title: "仓库", type: "bigint", bind: { key: "WMS_Warehouse", data: [] }, width: 110, showOverflowTooltip: true, align: "left" },
        { field: "MaterialId", title: "物料", type: "bigint", bind: { key: "WMS_Material", data: [] }, width: 130, showOverflowTooltip: true, align: "left" },
        { field: "Material.MaterialCode", title: "物料代码", type: "string", width: 120, hidden: true, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "Qty", title: "库存数量", type: "decimal", width: 90, require: true, showOverflowTooltip: true, align: "left" },
        { field: "Material.UnitName", title: "单位", type: "string", width: 90, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "WeightQty", title: "库存重量", type: "decimal", width: 120, showOverflowTooltip: true, align: "left" },
        { field: "Material.DoubleUnitName", title: "第二单位", type: "string", width: 90, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "IsValid", title: "是否有效", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "CreateId", title: "创建用户", type: "bigint", width: 80, hidden: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "Creator", title: "创建人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        { field: "CreateTime", title: "创建时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
        { field: "ModifyId", title: "修改用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Modifier", title: "修改人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        { field: "ModifyTime", title: "修改时间", type: "datetime", width: 120, showOverflowTooltip: true, align: "left" },
        { field: "Remarks", title: "备注", type: "string", width: 150, showOverflowTooltip: true, align: "left" },
        ]);
        const detail = ref({ columns: [] });
        const details = ref([]);
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
            details
        };
    },
});
</script>
